#ifndef	__LATIN1ENCODING_H__
#define	__LATIN1ENCODING_H__

namespace BFX
{

//
// REFLatin1Encoding is a simple override to optimize the GetString version of REFLatin1Encoding. 
// because of the best fit cases we can't do this when encoding the string, only when decoding
//
class REFLatin1Encoding : public REFEncoding
{
public:
	REFLatin1Encoding();
	virtual ~REFLatin1Encoding();

	//
	// Overrides
	//
	// Calculates the maximum number of bytes produced by encoding the specified number of characters.
	virtual int GetMaxByteCount(int nCount) const;
	// Calculates the maximum number of characters produced by decoding the specified number of bytes.
	virtual int GetMaxCharCount(int nCount) const;

	// Calculates the number of characters produced by decoding a sequence of bytes.
	virtual int GetCharCount(const BYTE* pBytes, int nCount, REFDecoder* pDecoder) const;
	// Decodes a sequence of bytes into a set of characters.
	virtual int GetChars(const BYTE* pBytes, int nByteCount, OUT UCHAR* pChars, int nCharCount, REFDecoder* pDecoder) const;

	// Calculates the number of bytes produced by encoding a set of characters.
	virtual int GetByteCount(const UCHAR* pChars, int nCount) const;
	// Encodes a set of characters into a sequence of bytes.
	virtual int GetBytes(const UCHAR* pChars, int nCharCount, OUT BYTE* pBytes, int nByteCount) const;
};

}	//	namespace BFX

#endif	//	__LATIN1ENCODING_H__
